import request from '@/utils/request'

// 获取部门列表、
// export const grtDepartments = () => {
//   request.get('/company/department')
// }
export function getDepartment() {
  return request({
    url: '/company/department'
  })
}

// 获取部门负责人
export const getManagerList = () => request.get('/sys/user/simple')

// 新增部门
export const addDept = data => request.post('/company/department', data)
// 获取部门详情
export const getDepDetail = id => request.get(`/company/department/${id}`)
// 编辑部门
export function editDept(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data

  })
}
// 删除部门
// export const delDept = id => request.delete(`/company/department${id}`)
export function delDepartment(id) {
  return request({
    method: 'delete',
    url: `/company/department/${id}`
  })
}
